package com.demo.component;

import com.demo.model.User;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author krystal
 * @date 2023/3/6 22:03
 */
@Component
public class UserBeans {
    //@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    @Scope("prototype")
    @Bean
    public User user1(){
        User user=new User();
        user.setId(4);
        user.setName("baekhyun");
        user.setPassword("30");
        return user;
    }
}
